With the increases in the size and the amount of code of computer application programs, and the promotion of the program modularization, more and more program developers avoid repetitive programming work by referencing existing common codes (such as Common Library). These repetitively-used codes may include Program Class and other code packets, which are components or modules to constitute an application program. A great application program may be constituted of a plurality of such program modules, and there may usually be hierarchical relationship between these program modules (which also can be understood as a father-son relationship or invoking dependence relationship). Now when many application program are developed, tested or run, it is necessary to transmit/invoke/load these repetitively-usable program components or modules with hierarchical relationship through networks.
Now, there are several technical solutions for transmitting program modules through networks. One is to load the entire Library. Since the Library normally is big in size, and what is really needed to be invoked is only partial modules in the Library, loading the entire Library may cause unnecessary content transmission, extending the loading period.
The second technical solution in the prior art is to only load necessary code units. For example, Widget A of a client needs 100 code packages in some Library, while Widget B of the client needs 50 code packages in the Library (in which, some of code packages are the same with the code packages needed by the Widget A), and although during the transmission, the Widgets A and B both can only request a server end to transmit its needed code packages, can also avoid transmitting the same code packages, and can avoid the transmission of unnecessary and repetitive code contents, the Widgets A and B need to issue a request to the server for each of its needed code packages, resulting in rapid increase of the number of network requests, which will also extend the loading period greatly.
The third technical solution in prior art is to pack the code packages needed by different applications (such as Widget) of the client by program developers in advance, and then, when invoking each Widget, the packed program packages are directly sent to the client. The advantage of such technical solution is that loading the entire Library can be avoided, and excessive network requests can also be avoided, but the disadvantage is that numerous repetitive code packages may be sent to the client, since the code packages needed by the Widget A of the client and the code packages needed by the Widget B have repetition, in the case of loose-coupling the program development (in which, the loose-coupling indicates there are a plurality developers for some application program, for example, the developers of the Widget A and the developers of the Widget B do not know whether the Widget developed by each other needs the same code packages), different program developers can not know which of the code packages are repetitive in advance.